<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <base th:href="${#request.getContextPath() + '/system/'}"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
    <!-- Reset Stylesheet -->
    <link rel="stylesheet" href="resources/css/reset.css" type="text/css"
          media="screen"/>
    <!-- Main Stylesheet -->
    <link rel="stylesheet" href="resources/css/style.css" type="text/css"
          media="screen"/>
    <link rel="stylesheet" href="resources/css/invalid.css" type="text/css"
          media="screen"/>

    <!--                       Javascripts                       -->
    <!-- jQuery -->
    <script type="text/javascript"
            src="resources/scripts/jquery-1.3.2.min.js"></script>
    <!-- jQuery Configuration -->
    <script type="text/javascript"
            src="resources/scripts/simpla.jquery.configuration.js"></script>

    <script th:inline="javascript">
        //修改管理员密码
        function updatePassword(){
            var npassword = $("#newpassword").val();
            var apassword = $("#againpassword").val();

            if(npassword == null || npassword.trim() == ""){
                alert("新的密码不能为空！");
                return;
            }

            if(npassword != apassword){
                alert("两次密码输入的不相同！");
                return;
            }

            $("#formid").submit();

        }
    </script>

</head>
<body>
<div id="main-content">
    <div class="content-box">
        <!-- End .content-box-header -->
        <div class="content-box-content">
            <h2>修改管理员密码</h2>

            <div th:if="${error == 0}">
                <font color="red">旧密码输入错误</font>
            </div>

            <form id="formid" th:action="${#request.getContextPath() + '/user/updatepassword'}">
                <input name="id" type="hidden" th:value="${#session.getAttribute(T(com.video.commons.loginaop.LoginContact).BACK_USER.getKey()).id}"/>
                <p>
                    旧的密码：
                </p>
                <p>
                    <input
                            class="text-input small-input" type="text"
                            name="oldpassword" placeholder="请输入旧的密码"/>
                </p>
                <p>
                    新的密码：
                </p>
                <p>
                    <input
                            class="text-input small-input" type="text"
                            name="newpassword" id="newpassword" placeholder="请输入新的密码"/>
                </p>
                <p>
                    重复密码：
                </p>
                <p>
                    <input
                            class="text-input small-input" type="text"
                            id="againpassword" placeholder="请再次输入密码"/>
                </p>
                <p>
                    <button type="button" class="mybutton" onclick="updatePassword();">修改密码</button>
                </p>
            </form>

            <br/>
            <hr/>
            <br/>

            <div class="tab-content default-tab" id="tab1">

            </div>
        </div>
        <!-- End .content-box-content -->
    </div>
</div>
<!-- End #main-content -->
</body>
</html>